<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>GL_CAR</title>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  <t:base type="uploadify"></t:base>
  <script type="text/javascript">
  //编写自定义JS代码
  </script>
 </head>
 <body>
  <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="glCarController.do?doAdd" callback="jeecgFormFileCallBack@Override" tiptype="6">
					<input id="id" name="id" type="hidden" value="${glCarPage.id }"/>
		<table style="width: 99%;" cellpadding="0" cellspacing="1" class="formtable">
				<tr>
					<td align="right">
						<label class="Validform_label">
						单位/个人名称:
						</label>
					</td>
					<td class="value" colspan="3">
					     	 <input id="fullname" name="fullname" type="text" maxlength="150" style="width: 90%"  ignore="ignore" />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">单位全称</label>
						</td>
					</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							联系人:
						</label>
					</td>
					<td class="value">
					     	 <input id="contacter" name="contacter" type="text" maxlength="20" style="width: 150px"  ignore="ignore" />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">联系人姓名</label>
						</td>
					<td align="right">
						<label class="Validform_label">
							联系电话:
						</label>
					</td>
					<td class="value">
					     	 <input id="mobile" name="mobile" type="text" maxlength="50" style="width: 150px"  ignore="ignore" />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">电话</label>
						</td>
					</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
						长期流向:
						</label>
					</td>
					<td class="value">
					     	 <input id="direction" name="direction" type="text" maxlength="50" style="width: 150px"  ignore="ignore" />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">服务区域</label>
						</td>
					<td align="right">
						<label class="Validform_label">
							车型:
						</label>
					</td>
					<td class="value">
					     	 <input id="truckcat" name="truckcat" type="text" maxlength="20" style="width: 150px"  ignore="ignore" />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">车型</label>
						</td>
					</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							车辆载重:
						</label>
					</td>
					<td class="value">
					     	 <input id="ratedload" name="ratedload" type="text" maxlength="50" style="width: 150px"  ignore="ignore" />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">载重</label>
						</td>
					<td align="right">
						<label class="Validform_label">
							车辆数量:
						</label>
					</td>
					<td class="value">
					     	 <input id="trucknum" name="trucknum" type="text" maxlength="20" style="width: 150px"  ignore="ignore" />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">数量</label>
						</td>
					</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							有效期开始:
						</label>
					</td>
					<td class="value">
							   <input id="validstartdate" name="validstartdate" type="text" style="width: 150px" class="Wdate" onClick="WdatePicker()"  datatype="*"  ignore="checked" />    
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">有效期开始</label>
						</td>
					<td align="right">
						<label class="Validform_label">
							有效期结束:
						</label>
					</td>
					<td class="value">
							   <input id="validenddate" name="validenddate" type="text" style="width: 150px" class="Wdate" onClick="WdatePicker()"  datatype="*"  ignore="checked" />    
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">有效期结束</label>
						</td>
					</tr>
				<%-- <tr>
					<td align="right">
						<label class="Validform_label">
							申请人编号:
						</label>
					</td>
					<td class="value">
					     	 <input id="userid" name="userid" type="text" maxlength="19" style="width: 150px"  datatype="n"  ignore="ignore" />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">申请人编号</label>
						</td>
					<td align="right">
						<label class="Validform_label">
							申请时间:
						</label>
					</td>
					<td class="value">
							   <input id="reqtime" name="reqtime" type="text" style="width: 150px" class="Wdate" onClick="WdatePicker()"  ignore="ignore" />    
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">申请时间</label>
						</td>
					<td align="right">
						<label class="Validform_label">
							信息来源:
						</label>
					</td>
					<td class="value">
					     	<t:dictSelect field="infosource" type="list"  typeGroupCode="REGSOURCE"   defaultVal="" hasLabel="false"  title="信息来源" ></t:dictSelect>  
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">信息来源</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							申请状态:
						</label>
					</td>
					<td class="value">
							  <t:dictSelect field="reqstate" type="list"  typeGroupCode="STANDARDVERIFYSTATUS"  defaultVal="${glCarPage.reqstate}" hasLabel="false"  title="申请状态" ></t:dictSelect>     
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">申请状态</label>
						</td>
					<td align="right">
						<label class="Validform_label">
							驾驶员姓名:
						</label>
					</td>
					<td class="value">
					     	 <input id="truckname" name="truckname" type="text" maxlength="10" style="width: 150px"  ignore="ignore" />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">驾驶员姓名</label>
						</td>
					</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							驾驶员资质信息:
						</label>
					</td>
					<td class="value">
		<div class="form jeecgDetail">
			<t:upload name="jsyzz" id="jsyzz" queueID="filediv_jsyzz" outhtml="false" uploader="cgUploadController.do?saveFiles"  extend="pic" buttonText='添加图片'  onUploadStart="jsyzzOnUploadStart"> </t:upload>
			<div class="form" id="filediv_jsyzz"></div>
			<script type="text/javascript">
				function jsyzzOnUploadStart(file){
					var cgFormId=$("input[name='id']").val();
					$('#jsyzz').uploadify("settings", "formData", {
						'cgFormId':cgFormId,
						'cgFormName':'gl_car',
						'cgFormField':'JSYZZ'
					});
				}
			</script>
		</div>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">驾驶员资质信息</label>
						</td>
					<td align="right">
						<label class="Validform_label">
							车辆资质信息:
						</label>
					</td>
					<td class="value">
		<div class="form jeecgDetail">
			<t:upload name="clzz" id="clzz" queueID="filediv_clzz" outhtml="false" uploader="cgUploadController.do?saveFiles"  extend="pic" buttonText='添加图片'  onUploadStart="clzzOnUploadStart"> </t:upload>
			<div class="form" id="filediv_clzz"></div>
			<script type="text/javascript">
				function clzzOnUploadStart(file){
					var cgFormId=$("input[name='id']").val();
					$('#clzz').uploadify("settings", "formData", {
						'cgFormId':cgFormId,
						'cgFormName':'gl_car',
						'cgFormField':'CLZZ'
					});
				}
			</script>
		</div>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">车辆资质信息</label>
						</td>
					</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							驾驶证:
						</label>
					</td>
					<td class="value">
		<div class="form jeecgDetail">
			<t:upload name="jsz" id="jsz" queueID="filediv_jsz" outhtml="false" uploader="cgUploadController.do?saveFiles"  extend="pic" buttonText='添加图片'  onUploadStart="jszOnUploadStart"> </t:upload>
			<div class="form" id="filediv_jsz"></div>
			<script type="text/javascript">
				function jszOnUploadStart(file){
					var cgFormId=$("input[name='id']").val();
					$('#jsz').uploadify("settings", "formData", {
						'cgFormId':cgFormId,
						'cgFormName':'gl_car',
						'cgFormField':'JSZ'
					});
				}
			</script>
		</div>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">驾驶证</label>
						</td>
					<td align="right">
						<label class="Validform_label">
							行车证:
						</label>
					</td>
					<td class="value">
		<div class="form jeecgDetail">
			<t:upload name="xcz" id="xcz" queueID="filediv_xcz" outhtml="false" uploader="cgUploadController.do?saveFiles"  extend="pic" buttonText='添加图片'  onUploadStart="xczOnUploadStart"> </t:upload>
			<div class="form" id="filediv_xcz"></div>
			<script type="text/javascript">
				function xczOnUploadStart(file){
					var cgFormId=$("input[name='id']").val();
					$('#xcz').uploadify("settings", "formData", {
						'cgFormId':cgFormId,
						'cgFormName':'gl_car',
						'cgFormField':'XCZ'
					});
				}
			</script>
		</div>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">行车证</label>
						</td>
					</tr> --%>
					<tr>
						<td align="right">
						<label class="Validform_label">
							备注:
						</label>
					</td>
					<td class="value" colspan="3">
					     	 <input id="remark" name="remark" type="text" maxlength="500" style="width: 90%"  ignore="ignore" />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">备注</label>
						</td>
					</tr>
				
				
			</table>
		</t:formvalid>
 </body>
	  	<script type="text/javascript">
	  		function jeecgFormFileCallBack(data){
	  			if (data.success == true) {
					uploadFile(data);
				} else {
					if (data.responseText == '' || data.responseText == undefined) {
						$.messager.alert('错误', data.msg);
						$.Hidemsg();
					} else {
						try {
							var emsg = data.responseText.substring(data.responseText.indexOf('错误描述'), data.responseText.indexOf('错误信息'));
							$.messager.alert('错误', emsg);
							$.Hidemsg();
						} catch(ex) {
							$.messager.alert('错误', data.responseText + '');
						}
					}
					return false;
				}
				if (!neibuClickFlag) {
					var win = frameElement.api.opener;
					win.reloadTable();
				}
	  		}
	  		function upload() {
					$('#jsyzz').uploadify('upload', '*');	
					$('#clzz').uploadify('upload', '*');	
					$('#jsz').uploadify('upload', '*');	
					$('#xcz').uploadify('upload', '*');	
			}
			
			var neibuClickFlag = false;
			function neibuClick() {
				neibuClickFlag = true; 
				$('#btn_sub').trigger('click');
			}
			function cancel() {
					$('#jsyzz').uploadify('cancel', '*');
					$('#clzz').uploadify('cancel', '*');
					$('#jsz').uploadify('cancel', '*');
					$('#xcz').uploadify('cancel', '*');
			}
			function uploadFile(data){
				if(!$("input[name='id']").val()){
					if(data.obj!=null && data.obj!='undefined'){
						$("input[name='id']").val(data.obj.id);
					}
				}
				if($(".uploadify-queue-item").length>0){
					upload();
				}else{
					if (neibuClickFlag){
						alert(data.msg);
						neibuClickFlag = false;
					}else {
						var win = frameElement.api.opener;
						win.reloadTable();
						win.tip(data.msg);
						frameElement.api.close();
					}
				}
			}
	  	</script>
</html>